import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { TAmuletSpiritConfig } from "../../../Message/Db/Tables/TAmuletSpiritConfig";
type int = number;
//class AmuletSpiritConfig
    
    export  class AmuletSpiritConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (AmuletSpiritConfig._instance != null) 
            {
                throw new Error(" AmuletSpiritConfig 单例 ");
            }
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_amulet_spirit_config.json");
            this.write(loc1);
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TAmuletSpiritConfig();
                loc1.level = loc2.level;
                loc1.upgradeMaterials = loc2.upgradeMaterials;
                loc1.upgradeMoney = loc2.upgradeMoney;
                loc1.breakMaterials = loc2.breakMaterials;
                loc1.breakMoney = loc2.breakMoney;
                loc1.wuxingAdd = loc2.wuxingAdd;
                loc1.attrAdd = loc2.attrAdd;
                this._map[loc1.level] = loc1;
            }
            return;
        }

        public getConfigByLevel(arg1: int): TAmuletSpiritConfig
        {
            return this._map[arg1] as TAmuletSpiritConfig;
        }

        public static get instance(): AmuletSpiritConfig
        {
            if (AmuletSpiritConfig._instance == null) 
            {
                AmuletSpiritConfig._instance = new AmuletSpiritConfig();
            }
            return AmuletSpiritConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: AmuletSpiritConfig;
    }
